﻿<UserControl x:Class="Flare.Pages.ITContract.Create" xmlns:Controls="clr-namespace:Flare.Controls"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:db="clr-namespace:Flare.DB"
             mc:Ignorable="d"
             d:DesignHeight="800" d:DesignWidth="1200">

    <UserControl.Resources>

        <ObjectDataProvider x:Key="ContactServicesDataSet" ObjectType="{x:Type db:contract_services}"
                            MethodName="Index" IsAsynchronous="False"/>

        <ObjectDataProvider x:Key="ContactProviderDataSet" ObjectType="{x:Type db:contract_providers}"
                            MethodName="Index" IsAsynchronous="False" />

        <ObjectDataProvider x:Key="ContactLocationDataSet" ObjectType="{x:Type db:general_departments}"
                            MethodName="Index" IsAsynchronous="False" />
    </UserControl.Resources>

    <DockPanel LastChildFill="False" VerticalAlignment="Top">

        <Controls:FlameMenu x:Name="id_service" Caption="Вид услуги" DockPanel.Dock="Top"  SelectedValuePath="id_service" DisplayMemberPath="service" 
                      ItemsSource="{Binding Source={StaticResource ContactServicesDataSet}}" />

        <Controls:FlameMenu x:Name="id_provider" Caption="Поставщик" DockPanel.Dock="Top"  SelectedValuePath="id_provider" DisplayMemberPath="provider" 
                      ItemsSource="{Binding Source={StaticResource ContactProviderDataSet}}" />

        <Controls:FlameMenu x:Name="id_department" Caption="Отдел" DockPanel.Dock="Top"  SelectedValuePath="id_department" DisplayMemberPath="department"
                      ItemsSource="{Binding Source={StaticResource ContactLocationDataSet}}" />

        <Controls:FlameTbox x:Name="contract_number" Header="Номер контракта" Margin="10,40,0,0" DockPanel.Dock="Top" Width="400" 
                            Text="{Binding SelectedItem.default_contract_number, ElementName=id_provider, IsAsync=True}" />

        <Controls:FlameTbox x:Name="contract_description" Header="Примечание к контракту" Margin="10,10,0,0" DockPanel.Dock="Top" Width="600" />

        <Button Content="Добавить" Margin="10,40,0,0" Name="insertButton" HorizontalAlignment="Left" DockPanel.Dock="Top" Click="insertButton_Click"/>
    </DockPanel>

</UserControl>
